package com.example.treehandle.api;

import com.example.treehandle.dao.MenuDAO;
import com.example.treehandle.dataobject.Menu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MenuAPI {

	@Autowired
	private MenuDAO menuDAO;

	@GetMapping("/menu/{id}")
	public Menu getById(@PathVariable("id") Integer id) {
		return menuDAO.getById(id);
	}

}